import { NgModule } from '@angular/core';
import { ChildrenOutletContexts, RouterModule, Routes } from '@angular/router';
import { AicompetenceComponent } from './aicompetence.component';
import { ContractextractionComponent } from './components/contractextraction/contractextraction.component';
import { ContractextractiondetailComponent } from './components/contractextractiondetail/contractextractiondetail.component';
import { ContractextractiondataComponent } from './components/contractextractiondata/contractextractiondata.component';
import { ContractextractionretrievalComponent } from './components/contractextractionretrieval/contractextractionretrieval.component';
import { ContractextractionmodelComponent } from './components/contractextractionmodel/contractextractionmodel.component';
import { ContractextractioneffectComponent } from './components/contractextractioneffect/contractextractioneffect.component';
import { ContractextractionmodelhomeComponent } from './components/contractextractionmodelhome/contractextractionmodelhome.component';
import { ContractextractionmodeleditComponent } from './components/contractextractionmodeledit/contractextractionmodeledit.component';
import { AiapplyComponent } from './components/aiapply/aiapply.component';
import { ApiserveComponent } from './components/apiserve/apiserve.component';
import { DiyocrComponent } from './components/diyocr/diyocr.component';
import { ControlabilityComponent } from './components/controlability/controlability.component';
import { AihelpComponent } from './components/aihelp/aihelp.component';
import { AbilitybasicComponent } from './components/abilitybasic/abilitybasic.component'
import { AbilitydetailComponent } from './components/abilitydetail/abilitydetail.component'
import { CreateappComponent } from './components/createapp/createapp.component'
import {AppoverviewComponent} from './components/appoverview/appoverview.component'
 import {AppdetailComponent} from './components/appdetail/appdetail.component'
 
const routes: Routes = [{
  path: 'aicompetence',
  redirectTo: ''
},
{
  path: '',
  component: AicompetenceComponent,
  children: [{
    path: 'detail',
    component: ContractextractiondetailComponent,
    children: [{
      path: 'data',
      component: ContractextractiondataComponent,
    }, {
      path: "retrieval",
      component: ContractextractionretrievalComponent
    }, {
      path: 'model',
      component: ContractextractionmodelhomeComponent,
      children: [{
        path: '',
        component: ContractextractionmodelComponent
      },
      {
        path: 'modeledit',
        component: ContractextractionmodeleditComponent
      }
      ]
    }, {
      path: 'effect',
      component: ContractextractioneffectComponent
    },
    {
      path: '**',
      redirectTo: 'data',
    }
    ]
  },
  {
    path: 'aiapply',
    component: AiapplyComponent,
    children: [{
      path: 'contractextraction',
      component: ContractextractionComponent
    }, {
      path: 'apiserve',
      component: ApiserveComponent
    }, {
      path: 'diyocr',
      component: DiyocrComponent
    }, {
      path: 'controlability',
      component: ControlabilityComponent
    },{
      path: 'appdetail',
      component: AppdetailComponent
    },
  ]
  }, 
  {
    path: 'aihelp',
    component: AihelpComponent
  }, {
    path: 'abilitybasic',
    component: AbilitybasicComponent
  }, {
    path: 'abilitydetail',
    component: AbilitydetailComponent
  }, {
    path: 'createapp',
    component: CreateappComponent
  },{
    path: 'appoverview',
    component: AppoverviewComponent
  },

  {
    path: '**',
    redirectTo: 'detail'
  }]
}, {
  path: '**',
  redirectTo: ''
}
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class AicompetenceRoutingModule { }